home *** CD-ROM | disk | FTP | other *** search
- package swings
- {
- import flash.display.MovieClip;
- import flash.events.Event;
- import flash.text.TextField;
-
- public class LoaderScript extends MovieClip
- {
-
-
- public var grad:MovieClip;
-
- public var loadPercent:TextField;
-
- public function LoaderScript()
- {
- super();
- addEventListener(Event.ENTER_FRAME,checkLoad);
- }
-
- private function checkLoad(param1:Event) : *
- {
- var _loc2_:* = undefined;
- _loc2_ = SwingsGame(parent).framesLoaded / SwingsGame(parent).totalFrames * 100;
- loadPercent.text = int(_loc2_) + "%";
- grad.scaleY = 1 - SwingsGame(parent).framesLoaded / SwingsGame(parent).totalFrames;
- if(SwingsGame(parent).framesLoaded >= SwingsGame(parent).totalFrames)
- {
- removeEventListener(Event.ENTER_FRAME,checkLoad);
- loadNext();
- }
- }
-
- private function loadNext() : *
- {
- SwingsGame(parent).fade("title");
- }
- }
- }
-